<?php require_once(TEMPLATEPATH . '/admin/admin_panel.php');
$pandatheme_panel = new ControlPanel();

// BREADCRUMBS
require_once (TEMPLATEPATH.'/admin/includes/breadcrumbs.php');

// SIDEBARS REGISTRATION
require_once (TEMPLATEPATH.'/admin/includes/sidebars.php');

// WIDGETS
require_once (TEMPLATEPATH.'/admin/includes/widgets/flickr.php');
require_once (TEMPLATEPATH.'/admin/includes/widgets/twitter.php');
require_once (TEMPLATEPATH.'/admin/includes/widgets/recent_posts.php');
require_once (TEMPLATEPATH.'/admin/includes/widgets/popular_posts.php');
require_once (TEMPLATEPATH.'/admin/includes/widgets/ads300.php');
require_once (TEMPLATEPATH.'/admin/includes/widgets/ads125.php');
require_once (TEMPLATEPATH.'/admin/includes/widgets/subscribe.php');
require_once (TEMPLATEPATH.'/admin/includes/widgets/tabs.php');

// CUSTOM WRITE PANEL
require_once (TEMPLATEPATH.'/admin/includes/write_panel.php');

// AUTOMATIC THUMBS
require_once (TEMPLATEPATH.'/admin/includes/auto_thumbs.php');

// PAGINATION
require_once (TEMPLATEPATH.'/admin/includes/wp-pagenavi.php');

// SHORTCODES
require_once (TEMPLATEPATH.'/admin/includes/shortcodes/buttons.php');
require_once (TEMPLATEPATH.'/admin/includes/shortcodes/columns.php');
require_once (TEMPLATEPATH.'/admin/includes/shortcodes/icons.php');
require_once (TEMPLATEPATH.'/admin/includes/shortcodes/lists.php');
require_once (TEMPLATEPATH.'/admin/includes/shortcodes/slider.php');
require_once (TEMPLATEPATH.'/admin/includes/shortcodes/posts.php');
require_once (TEMPLATEPATH.'/admin/includes/shortcodes/shortcodes.php');

// DO SHORTCODES AT SIDEBARS
add_filter('widget_text', 'do_shortcode');

// CUSTOM LENGHT OF EXCERPT
function new_excerpt_length($length) { return 25; }
add_filter('excerpt_length', 'new_excerpt_length');

// REMOVE [...] FROM EXCERPT
function trim_excerpt($text) { return rtrim($text,'[...]'); }
add_filter('get_the_excerpt', 'trim_excerpt');

// TIME DELAY FOR RSS FEED
function publish_later_on_feed($where) {
global $wpdb;if ( is_feed() ) {
$now = gmdate('Y-m-d H:i:s');
$wait = '10'; // time delay
$device = 'MINUTE'; // MINUTE, HOUR, DAY, WEEK, MONTH, YEAR
$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
}
return $where;
}
add_filter('posts_where', 'publish_later_on_feed');

// AUTOMATIC RSS FEED
add_theme_support( 'automatic-feed-links' );

add_theme_support('post-thumbnails');

// MENU FOR WP 3.0
add_action( 'init', 'register_my_menus' );
function register_my_menus() {
	register_nav_menus(
		array(
			'primary-menu' => __('Menu')
		)
	);
}

// ACTIVATE WORDPRESS THUMBS
// add_theme_support('post-thumbnails');

//OTHER THEMES
function other_themes_setup() {add_menu_page("Buy Themes", "Buy Themes", 'edit_themes', 'otherthemes', 'other_themes_page', '../wp-content/themes/polafolio/favicon.ico');}
function other_themes_page(){
?>
<div class="wrap">
<iframe name="pandapreview" id="pandapreview" scrolling="auto" frameborder="0" style="width: 100%; height: 550px;" allowtransparency="true" src="http://pandathemes.com/wordpress-themes/"></iframe>
</div><!-- end wrap-->
<?php } 
add_action('admin_menu', 'other_themes_setup');
?>